﻿@model IEnumerable<eShopLegacyMVC.Models.CatalogItem>

<table class="table">
    <thead>
        <tr class="esh-table-header">
            <th>
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Description)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CatalogBrand.Brand)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CatalogType.Type)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Price)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.PictureFileName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.AvailableStock)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RestockThreshold)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.MaxStockThreshold)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
            {
            <tr>
                <td>
                    <img class="esh-thumbnail" src="@item.PictureUri" />
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CatalogBrand.Brand)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CatalogType.Type)
                </td>
                <td class="esh-table-price">
                    @Html.DisplayFor(modelItem => item.Price)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PictureFileName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.AvailableStock)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.RestockThreshold)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.MaxStockThreshold)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "esh-table-link" }) |
                    @Html.ActionLink("Details", "Details", new { id = item.Id }, new { @class = "esh-table-link" }) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { @class = "esh-table-link" })
                </td>
            </tr>
        }
    </tbody>

</table>